﻿using Abp.Application.Services.Dto;
using shenghua.Member.Coupons;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace shenghua.Marketing.Coupons.Dto
{
    public class MemberCouponDto: EntityDto
    {
        public long MemberId { get; set; }
        public int CouponId { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public string Profile { get; set; }

        public double MinAmount { get; set; }
        public int MinCount { get; set; }

        public DateTime Begin { get; set; }
        public DateTime End { get; set; }
        public bool IsOverdue { get; set; }

        public double Amount { get; set; }
        public CouponTargetType TargetType { get; set; }
        public MemberCouponStatus Status { get; set; }

        public bool IsUsed { get; set; }
        public bool IsUnUsed { get; set; }

        public MemberCouponDto(MemberCoupon memberCoupon)
        {
            Id = memberCoupon.Id;
            MemberId = memberCoupon.MemberId;
            CouponId = memberCoupon.CouponId;
            Name = memberCoupon.Name;
            Description = memberCoupon.Description;
            Profile = memberCoupon.Profile;
            MinAmount = memberCoupon.Condition.MinAmount;
            MinCount = memberCoupon.Condition.MinCount;
            Begin = memberCoupon.TimeLimit.Begin;
            End = memberCoupon.TimeLimit.End;
            IsOverdue = memberCoupon.IsOverdue;
            Amount = memberCoupon.Amount;
            TargetType = memberCoupon.TargetType;
            Status = memberCoupon.Status;
            IsUsed = memberCoupon.IsUsed;
            IsUnUsed = memberCoupon.IsUnUsed;
        }
    }
}
